////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once

#ifndef __WN_PLATFORM_SURFACE_WINDOWS_H__
#define __WN_PLATFORM_SURFACE_WINDOWS_H__

#include "WNPlatform/inc/WNSurface.h"
#include "WNContainers/inc/WNResourcePointer.h"

namespace WNPlatform {
    class WNSurfaceManagerWindows;
    class WNSurfaceWindows : public WNSurface {
    public:
        virtual WNNativeGraphicsHandle GetNativeGraphicsHandle();
        
        virtual WNSurfaceError Resize(WN_UINT32 _width, WN_UINT32 _height);
        virtual WNSurfaceError Move(WN_UINT32 _x, WN_UINT32 _y);
        virtual WN_BOOL IsFullscreen();
        virtual WNSurfaceError SetFullscreen(WN_BOOL _fs);

        virtual WN_UINT32 GetWidth() const;
        virtual WN_UINT32 GetHeight() const;
        virtual WN_UINT32 GetX() const;
        virtual WN_UINT32 GetY() const;
        WNSurfaceWindows(WNPlatform::WNSurfaceManagerWindows& _surfaceManager);

    private:
        friend class WNSurfaceManagerWindows;
        WN_VOID ProcessCallback(UINT _msg, LPARAM _lparam, WPARAM _wparam);
        HWND GetNativeWindowHandle();
        WN_VOID SetNativeWindowHandle(HWND _handle);
        WNPlatform::WNSurfaceManagerWindows& mSurfaceManager;
        WN_BOOL mFullscreen;
        WN_UINT32 mXSize;
        WN_UINT32 mYSize;
        WN_UINT32 mWidth;
        WN_UINT32 mHeight;
        HWND mNativeWindowHandle;
    };
}

#endif // __WN_PLATFORM_SURFACE_WINDOWS_H__